Modular Type Classes

by Derek Dreyer, Robert Harper, and Manuel M. T. Chakravarty

ML modules and Haskell type classes have proven to be highly effective tools for program structuring. Modules emphasize explicit configuration of program components and the use of data abstraction. Type classes emphasize implicit program construction and ad hoc polymorphism. In this paper, we show how the implicitly-typed style of type class programming may be supported within the framework of an explicitly-typed module language by viewing type classes as a particular mode of use of modules. This view offers a harmonious integration of modules and type classes, where type class features, such as class hierarchies and associated types, arise naturally as uses of existing module-language constructs, such as module hierarchies and type components. In addition, programmers have explicit control over which type class instances are available for use by type inference in a given scope. We formalize our approach as a Harper-Stone-style elaboration relation, and provide a sound type inference algorithm as a guide to implementation.

De-Scheming MIT?

Will freshman scheming be the same if their schemes are more about robots and less about Scheme?

The MIT is going to change its curriculum structure that was famous for teaching Scheme in introductory courses. One force behind the reform is no one else than Harold Abelson, famous for his marvelous Scheme opus SICP. But why changing?

The new curriculum is designed with three goals in mind: greater flexibility in requirements, better integration of electrical engineering and computer science, and more depth to better prepare students for graduate school or real-world design challenges, he said.

And programming language wise:

Content-wise, the class is a mix as well. The first four weeks of C1 will be a lot like the first four weeks of 6.001, Abelson said. The difference is that programming will be done in Python and not Scheme.

A sign of the times?

Video: The Scala Experiment

An hour long presentation by Martin Odersky on The Scala Experiment is available on Google Video. Covers a lot of territory, including (naturally) integration of FP/OOP, Erlang style Actors, Components vs. APIs, ML Functors, mixins, self-types - to name a few. The video is fuzzy on the slides, so it helps to have the pdf of the slides handy.

I can't say that I groked all the implications of the ground covered, much less the exact syntax, but at least it gave me a better feel for some of the PL problems that the Scala project is trying to address.

Haskell -> Javascript converter, kind of

(I looked but didn't see any other references to this on LtU)

There is now a Haskell -> Javascript converter using the York Haskell Compiler's (YHC's) "core" format.

From the YHC Core page:

Yhc.Core is a simple core Haskell-like language, feature case statements, let statements, top level lambda's and data values. Much of the syntactic sugar present in Haskell has gone (list comprehensions, typeclasses, overloaded names, nested lambdas)

The strengths of Yhc.Core are:

* Simple representation of Haskell
* Relatively simple to relate Core to original Haskell
* Source locations are preseved
* Minimal name mangling
* Few syntactic forms

The weaknesses are:

* Yhc cannot compile Yhc Core files, format is write only (fix is being worked on)
* Types are not present (hard to fix, a lot of work)

Second Life Faces Threat to its Virtual Economy

Second Life Faces Threat to its Virtual Economy

Groups of Second Life content creators were gathering digitally Tuesday to protest the dissemination of a program they worry could badly damage the virtual world's nascent economy.

The controversy gathered steam Monday when Linden Lab, which publishes Second Life, posted a blog alerting residents of the virtual world to the existence of a program or bot called CopyBot, which allows someone to copy any object in Second Life. That includes goods such as clothing that people purchase for their in-world avatars, and even the virtual PCs that computer giant Dell announced Tuesday it is going to sell in the digital world.

Related to this thread, especially my "Not Merely Predictable" post, as well as the various Lightweight Static Capabilities and Robust Composition threads. I'm absolutely convinced that a future language design will evolve to accomodate the development of distributed systems in which these kinds of issues are impossible to impose. Is it time to add an "object capability security" and/or "cooperation without vulnerability" (a great phrase from Mark Miller) category to LtU?

Sun Open Sources Java Platform

SANTA CLARA, CALIF. November 13, 2006 Sun Microsystems, Inc. (NASDAQ: SUNW), the creator and leading advocate of Java technology, today announced it is releasing its implementations of Java technology as free software under the GNU General Public License version two (GPLv2). Available today are the first pieces of source code for Sun's implementation of Java Platform Standard Edition (Java SE) and a buildable implementation of Java Platform Micro Edition (Java ME). Details are available at: http://www.sun.com/opensource/java.

A bold move, as Tim O'Reilly says? You be the judge.

Can Abstract State Machines Be Useful in Language Theory?

Can Abstract State Machines Be Useful in Language Theory? Yuri Gurevich; Margus Veanes; Charles Wallace.

The abstract state machine (ASM) is a modern computation model. ASMs and ASM based tools are used in academia and industry, albeit in a modest scale. They allow you to give high-level operational semantics to computer artifacts and to write executable pecifications of software and hardware at the desired abstraction level. In connection to the 2006 conference on Developments in Language Theory, we point out several ways that we believe abstract state machines can be
useful to the DLT community.

I am not sure how useful this might be to LtU readers, but it is a nice introudction to ASMs.

Among the topics discussed are: concurrency, non-determinism, the notion of Universality (e.g., "Turing completenss") and the executability of the ASM notation (i.e., AsmL).

Writing A Lisp Interpreter In Haskell

(via Windley)

This seems like a nice writeup. The article even manages to introduce monads (without explicitly going into all the details), and provides the correct perspective about them (i.e., they are not just for IO). Also featured: Parsec and a bit irony (see footnote #2).

Testing Telecoms Software with Quviq QuickCheck

Testing Telecoms Software with Quviq QuickCheck by John Hughes, Thomas Arts, Joakim Johansson, Ulf Wiger.

We present a case study in which a novel testing tool, Quviq QuickCheck, is used to test an industrial implementation of the Megaco protocol. We considered positive and negative testing and we used our developed specification to test an old version in order to estimate how useful QuickCheck could potentially be when used early in development.The results of the case study indicate that, by using Quviq QuickCheck, we would have been able to detect faults early in the development.We detected faults that had not been detected by other testing techniques. We found unclarities in the specifications and potential faults when the software is used in a different setting. The results are considered promising enough to Ericsson that they are investing in an even larger case study, this time from the beginning of the development of a new product.

That's right, the illustrious John Hughes is dropping out of school to do an Erlang startup!

SICP Translations

Being a slow news week (Ehud busy, chance for shameless plug, etc...), thought I'd take the opportunity to elevate the translation of SICP to the front page. Chapter 1 is mostly complete for Alice ML/SML-NJ, Oz, Haskell, O'Caml and Scala. Still a long way from done, though portions of Chapter 2 and 3 are there for Alice ML / SML-NJ.

Actually, the more interesting item I came across this week was in a visit to the Scala list. Seems that Martin Odersky has used many examples from SICP for a course on FP - specifically the Scala by Examples document. I knew I should've made Scala a higher priority - at minimum I can borrow ideas and learn Scala along the way.